#include <iostream>

using namespace std;

#ifdef __cplusplus
extern "C" {
#endif

#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"


#ifdef __cplusplus	
}
#endif

#include "A.h"

#include "tolua++.h"

#ifdef __cplusplus
//extern "C" {
#endif

int tolua_lesson08_open(lua_State *);

#ifdef __cplusplus	
//}
#endif

int main(int argc,char **argv)
{
	cout<<"This is lesson08 main cpp!"<<endl;

	A::getInstance()->say();

	lua_State* L = lua_open();
	tolua_lesson08_open(L);
	//lua_State *L = luaL_newstate();
	//luaopen_libs(L);
	luaL_openlibs(L);
	//luaopen_base(L);
	//tolua_lesson08_open(L);
	//cout<<" tolua_lesson08_open "<<endl;
	//luaL_openlibs(L);
	luaL_dofile(L,"main.lua");
	//cout<<" luaL_dofile "<<endl;
	//lua_close(L);
	//cout<<"close lua "<<endl;
	lua_close(L);
	return 0;	
}
